﻿using System;

namespace Gmantis.Uploader
{
    public class UploadProgressChangedEventArgs : EventArgs
    {
        // Fields
        private long _bytesUploaded;
        private int _progressPercentage;
        private long _totalBytesToUpload;
        private object _userState;

        // Methods
        public UploadProgressChangedEventArgs(long bytesUploaded, long totalBytesToUpload, object userState)
        {
            this._bytesUploaded = bytesUploaded;
            this._totalBytesToUpload = totalBytesToUpload;
            this._progressPercentage = Convert.ToInt32((long)((this._bytesUploaded * 100L) / this._totalBytesToUpload));
            this._userState = userState;
        }

        // Properties
        public long BytesUploaded
        {
            get
            {
                return this._bytesUploaded;
            }
        }

        public int ProgressPercentage
        {
            get
            {
                return this._progressPercentage;
            }
        }

        public long TotalBytesToUpload
        {
            get
            {
                return this._totalBytesToUpload;
            }
        }

        public object UserState
        {
            get
            {
                return this._userState;
            }
        }
    }
}
